
package com.dlc.shop.systemtest.api.order;

import com.dlc.shop.bean.model.OrderRefund;
import com.dlc.shop.bean.param.OrderRefundParam;
import com.dlc.shop.systemtest.constants.Constant;
import com.dlc.shop.systemtest.util.HttpUtil;

import java.util.Objects;

/**
 * @author xxw
 * @date 2023/2/27 9:30
 */
public class ShopOrderRefundApi {
    /**
     * 商家处理退款
     * @param orderRefundParam
     */
    public static void processRefundOrder(OrderRefundParam orderRefundParam, Long shopId){
        String url = Constant.SHOP_URL+"/order/refund/process";
        HttpUtil.put(url,orderRefundParam, Objects.equals(shopId, 1L) ? true:false);
    }

    /**
     * 商家处理退款
     * @param orderRefundParam
     */
    public static void processRefundOrder(OrderRefundParam orderRefundParam){
        String url = Constant.SHOP_URL+"/order/refund/process";
        HttpUtil.put(url,orderRefundParam);
    }
    /**
     * 商家同意退款
     * @param orderRefundParam
     */
    public static void returnMoney(OrderRefundParam orderRefundParam){
        String url = Constant.SHOP_URL+"/order/refund/returnMoney";
        HttpUtil.put(url, orderRefundParam);

    }
    /**
     * 商家查看退款信息
     * */
    public static OrderRefund infoByrRefundId(Long refundId){
        String url = Constant.SHOP_URL+"/order/refund/info/"+refundId;
        return HttpUtil.get(url,OrderRefund.class);
    }
}
